package service;

import dao.TeaMenuDao;
import pojo.*;

import java.util.List;

/**
 * @author tao
 * @date 2021/11/11
 */
public class TeaMenuServiceImpl implements TeaMenuService{

    private TeaMenuDao teaMenuDao;

    public void setTeaMenuDao(TeaMenuDao teaMenuDao) {
        this.teaMenuDao = teaMenuDao;
    }

    public List<Clazz> selectAllClazz(int id) {
        return teaMenuDao.selectAllClazz(id);
    }

    public Clazz selectClazz(int id) {
        return teaMenuDao.selectClazz(id);
    }

    public int updateClazz(Clazz clazz) {
        return teaMenuDao.updateClazz(clazz);
    }

    public List<Student> selectAllStudent(int id) {
        return teaMenuDao.selectAllStudent(id);
    }

    public List<Work> selectAllWork(int id) {
        return teaMenuDao.selectAllWork(id);
    }

    public int addClazz(Clazz clazz) {
        return teaMenuDao.addClazz(clazz);
    }

    public int deleteClazz1(int id) {
        return teaMenuDao.deleteClazz1(id);
    }

    public int deleteClazz(int id) {
        return teaMenuDao.deleteClazz(id);
    }

    public Student selectOneStudent(int id) {
        return teaMenuDao.selectOneStudent(id);
    }

    public int addStudent(ClazzAndStudent cs) {
        return teaMenuDao.addStudent(cs);
    }

    public int studentSize(int clazzID) {
        return teaMenuDao.studentSize(clazzID);
    }

    public int addWork(Work work) {
        return teaMenuDao.addWork(work);
    }

    public Work selectWork(int id) {
        return teaMenuDao.selectWork(id);
    }

    public int updateWork(Work work) {
        return teaMenuDao.updateWork(work);
    }

    public int[] selectClazzStudent(int clazzId) {
        return teaMenuDao.selectClazzStudent(clazzId);
    }

    public int addStuWork(int sid, int wid) {
        return teaMenuDao.addStuWork(sid,wid);
    }

    public int workBookId() {
        return teaMenuDao.workBookId();
    }

    //======级联删除==========
    public int deleteStudentWork(int id) {
        return teaMenuDao.deleteStudentWork(id);
    }
    public int deleteWork(int id) {
        return teaMenuDao.deleteWork(id);
    }
    //=======================


    public List<MyWork> selectStudentWork(int wid) {
        return teaMenuDao.selectStudentWork(wid);
    }

    public MyWork selectAStudentWork(int swid) {
        return teaMenuDao.selectAStudentWork(swid);
    }

    public int updateAStudentWork(int swid,float score) {
        return teaMenuDao.updateAStudentWork(swid,score);
    }
}
